# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=mkinitfs
pkgver=3.4.5
_ver=${pkgver%_git*}
pkgrel=3
pkgdesc="Tool to generate initramfs images for Alpine"
url="https://git.alpinelinux.org/cgit/mkinitfs"
arch="all"
license="GPL-2.0-only"
# currently we do not ship any testsuite
options="!check"
makedepends_host="busybox kmod-dev util-linux-dev cryptsetup-dev linux-headers"
makedepends="$makedepends_host"
depends="busybox>=1.28.2-r1 apk-tools>=2.9.1 lddtree>=1.25 kmod"
subpackages="$pkgname-doc"
install="$pkgname.pre-upgrade $pkgname.post-install $pkgname.post-upgrade"
triggers="$pkgname.trigger=/usr/share/kernel/*"
source="https://dev.alpinelinux.org/archive/mkinitfs/mkinitfs-$_ver.tar.xz
	0001-mkinitfs-add-optional-support-for-pigz.patch
	"

build() {
	make VERSION=$pkgver-r$pkgrel
}

package() {
	make install DESTDIR="$pkgdir"
}

sha512sums="e12f603dd9a51c0afbafeca7b4a061733514c4cf509b1dd61cc37c94e6102e5b3439d7a0379e1e4179aeaff13a382dab985c9737812e52803f038c1b2bb97cf8  mkinitfs-3.4.5.tar.xz
50411c3cddbfc49837d750620c57393dc8dfa7beb91f02816345fd66c8068b12d9aef266e50fd7cdc2b3b5fa81f477cbfaed00a2b264055cfd34b61ceb03e63a  0001-mkinitfs-add-optional-support-for-pigz.patch"
